package com.ptswitch.material.test.zk;

import org.zkoss.zul.Listcell;
import org.zkoss.zul.Listitem;
import org.zkoss.zul.ListitemRenderer;

import com.ptswitch.material.model.material.Material;

public class MaterialListRenderer implements ListitemRenderer<Material> {

    @Override
    public void render(Listitem item, Material material, int index) throws Exception {
        item.setValue(material);
        new Listcell(String.valueOf(index + 1)).setParent(item);
        new Listcell(material.getCode()).setParent(item);
        new Listcell(material.getName()).setParent(item);
        new Listcell(material.getDescription()).setParent(item);
    }

}
